export default {
  activated () {
    // 为window对象，绑定scroll事件监听
    window.addEventListener('scroll', this.scrollHandler)
  },
  deactivated () {
    // 为window对象，移除scroll事件监听
    window.removeEventListener('scroll', this.scrollHandler)
  },
  methods: {
    // 滚动事件处理函数
    scrollHandler () {
      // console.log(window.scrollY)
      this.$route.meta.top = window.scrollY
    }
  }
}
